package com.liam.es.entity.es;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Data
@Document(indexName = "blog" ,type = "doc",useServerConfiguration = true,createIndex = true)
public class EsBlog {

    @Id
    private Integer id ;
//    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    @Field(type = FieldType.Auto)
    private String  title ;
    @Field(type = FieldType.Auto)
    private String  author ;
    @Field(type = FieldType.Auto)
    private String  content ;
    @Field(type = FieldType.Auto)
    private Date createTime ;
    @Field(type = FieldType.Auto)
    private Date updateTime ;
}
